package leets.leet2347;

import java.util.Arrays;

public class Solution {
    public String bestHand(int[] ranks, char[] suits) {
        boolean noFlush=false;
        for (int i=1;i<suits.length;i++){
            if (suits[i]!=suits[i-1]){
                noFlush=true;
                break;
            }
        }
        if (!noFlush){
            return "Flush";
        }
        int[] counts=new int[14];
        for (int rank:ranks){
            counts[rank]++;
        }
        int max=counts[0];
        for (int c:counts){
            if (max<c){
                max=c;
            }
        }
        if (max>=3){
            return "Three of a Kind";
        }else if (max==2){
            return "Pair";
        }
        return "High Card";
    }
}